<!DOCTYPE html>
<html lang="en" style="height:100%;">
<head>
    <meta charset="UTF-8">
    <title>固定底部footer</title>
</head>
<body style="height:100%;">
<div id="wrapper" style="min-height: 100%;position: relative">
    <div id="main" style="padding-bottom: 60px">

    </div>
    <div id="footer" style="position: absolute;
                                width: 100%;
                                height: 60px;
                                text-align: center;
                                bottom: 0">
        <h1>this is footer</h1>
    </div>
</div>
<script type="text/javascript">
    window.onload = getGoods(true).then(render, cao);


    function getGoods(flag) {
        return new Promise(function (resolve, reject) {
            //ajax operation
            setTimeout(function () {
                if (flag === true) {
                    resolve("yes");
                } else {
                    reject("no");
                }
            })
        })
    }

    function render(ret) {
        let date = '2015-09-03';
        var str = `时间是${date}`;
        console.log(str);
        console.log(ret.toString());
    }

    function cao(ret) {
        console.log(ret.toString())
    }

</script>
</body>

</html>